try:
    x = 1/2
except ZeroDivisionError as e:
    print('除0错误')
else:
    print(f'x = {x}') #输出0.5